/*
*公用数据的生成
*/

let Mock = require("mockjs");
let Random = Mock.Random;

/*
* @description 首页-下载url
* @export dowArr {object}
*/
let dowArr = {
    windows:
    {
        url: Mock.mock('@url'),

        ...Mock.mock({
            "update|1": true
        }),
        ...Mock.mock({
            "version|1-10.1-2": 1
        })
    },
    macos: {
        url: Mock.mock('@url'),

        ...Mock.mock({
            "update|1": true
        }),
        ...Mock.mock({
            "version|1-10.1-2": 1
        })
    },
    iphone: {
        url: Mock.mock('@url'),

        ...Mock.mock({
            "update|1": true
        }),
        ...Mock.mock({
            "version|1-10.1-2": 1
        })
    },
    android: {
        version: 1.2,
        url: Mock.mock('@url'),

        ...Mock.mock({
            "update|1": true
        })
    },
    h5url: {
        url: Mock.mock('@url'),
    }
}
/*
* @description footer-友情链接
* @export dowArr {object}
*/
let blogroll = [
    {
        LinkName: "MeCoin",
        LinkUrl: "#"
    },
    {
        LinkName: "火币",
        LinkUrl: "#"
    },
    {
        LinkName: "币全",
        LinkUrl: "#"
    },
    {
        LinkName: "币智慧",
        LinkUrl: "#"
    },
    {
        LinkName: "链外",
        LinkUrl: "#"
    },
    {
        LinkName: "币圈子",
        LinkUrl: "#"
    },
    {
        LinkName: "99EX",
        LinkUrl: "#"
    },
]
/*
* @description swiper-轮播图
* @export dowArr {object}
*/

let number = Mock.mock({
    "number|4-10": 100
})
let swiperArr = [];
let swiperData = [
    "https://bafangpublic.oss-cn-hangzhou.aliyuncs.com/oksupport/banner/20181224/1545620251131.png",
    "https://img.bafang.com/cdn/banner/20190730/1564478085562d735d0b4-666b-40bf-b129-c74acfdfd78d.png",
    "https://img.bafang.com/cdn/banner/20190730/15644550242350e944f2b-e213-4c0a-9ef5-f6a0c775129c.png",
    "https://bafangpublic.oss-cn-hangzhou.aliyuncs.com/oksupport/banner/20190524/155866883031279653ff3-8037-4b09-abb1-e6eb56b4b931.jpg",
    "https://bafangpublic.oss-cn-hangzhou.aliyuncs.com/oksupport/banner/20190529/155912832280376adeb63-10d7-4711-aace-8390affb5064.png",
    "https://img.bafang.com/cdn/banner/20190723/1563874205224f2087a2d-96ef-4776-88f8-bf8751f5e159.png",
]
for (var i = 0; i < number.number; i++) {
    let swiper =
    {
        // web: Random.image('264x124', '#50B347', '#FFF', Mock.mock('@word(5)')),
        // app: Random.image('264x124', '#50B347', '#FFF', Mock.mock('@word(5)')),
        web: swiperData[Math.floor(Math.random() * 4)],
        app: swiperData[Math.floor(Math.random() * 4)],
        text: Random.csentence(),
        title: Random.csentence(10),
        ...Mock.mock({
            "id|1-100": 1,
        }),
        web_link: Mock.mock('@url'),
        app_lin: Mock.mock('@url'),
    }
    swiperArr.push(swiper)
}

/*
* @description recommend 首页-推荐币种
* @export dowArr {object}
*/
let recommend = [];
for (let i = 0; i < 5; i++) {
    /*
    *图表数据的生成，默认生成60条
    */
    let charts = [];
    for (let j = 0; j < 60; j++) {
        charts.push(
            Mock.mock({
                "data|0-1000.0-4": 50,
            }).data

        )
    }
    recommend.push(
        Mock.mock({
            "CoinName": /^[A-Z]{3}$/,
            "PairBase|1": [
                "USDT",
                "BTC",
                "EOS",
                "ETH",
            ],
            "PairId|1-100": 1,
            "NewPrice|0-10.0-8": 1,
            "NewRmb|100-10000.0-2": 10,
            "Increase|-100-100.0-2": 1,
            "Charts": charts,
        })
    )
}

/*
* @description 工具--支持交易的计价单位
*/
let nclt = ["USD", "CNY", "RUB", "JPY", "KPW", "THB", "IDR", "PHP", "INR"]
let numeraire=[];
for (let i = 0; i < nclt.length; i++) {
    let eraire =
    {
        name: nclt[i],
        ...Mock.mock({
            "usable|1-2": true,
            "nameId|+1": 1
        }),
    }
    numeraire.push(eraire)
}



export default {
    dowArr,
    blogroll,
    swiperArr,
    recommend,
    numeraire,
}